package com.candoit.webapps.pricing.controllers;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.component.html.HtmlPanelGroup;

import com.candoit.webapps.pricing.model.CentroCostos;
import com.candoit.webapps.pricing.model.CentroCostosCriterio;
import com.candoit.webapps.pricing.model.CriterioDistribucion;
import com.candoit.webapps.pricing.model.Cuenta;
import com.candoit.webapps.pricing.util.QueryUtil;

@ManagedBean(name = "cuentaCentroCtrl")
@ViewScoped
public class CuentasCentroController extends AbstractController {
	
	private List<Cuenta> cuentas;
	private List<CentroCostos> centros;
	private HtmlPanelGroup dynamicDataTableGroup;
	
	public List<Cuenta> getCuentas() {
		return cuentas;
	}
	public void setCuentas(List<Cuenta> cuentas) {
		this.cuentas = cuentas;
	}
	public List<CentroCostos> getCentros() {
		return centros;
	}
	public void setCentros(List<CentroCostos> centros) {
		this.centros = centros;
	}
	public HtmlPanelGroup getDynamicDataTableGroup() {
		if (dynamicDataTableGroup == null){
			this.llenarListas();
		}
		return dynamicDataTableGroup;
	}
	public void setDynamicDataTableGroup(HtmlPanelGroup dynamicDataTableGroup) {
		this.dynamicDataTableGroup = dynamicDataTableGroup;
	}
	
	private void llenarListas(){
		cuentas = QueryUtil.getInstance().getCuentas();
		centros = QueryUtil.getInstance().getCentroCostos();
	}
	
	private void populateDynamicDataTable() {
		for (CentroCostos centro : centros){
			 
		}
    }
	
	
}
